/***************************************************************************
 * File name: EPubBasicEncryptionImp.h
 * Original author: caizhifei2003@163.com
 * Date: 2013.03.03
 ***************************************************************************/
#ifndef _EPUB_BASIC_ENCRYPTION_IMP_H_
#define _EPUB_BASIC_ENCRYPTION_IMP_H_

#include "IEPubBasicEncryption.h"
#include "EPubPointer.h"
#include "EPubEncryptedDataImp.h"
#include <map>
#include <string>

class EPubBasicEncryptionImp : public IEPubBasicEncryption
{
	typedef std::map<std::string, EPubPointer<EPubEncryptedDataImp>>			EncryptedDataList;
public:

	virtual EPUB_BasicFileType GetBasicFileType() const { return EPUB_BFT_META_INF_ENCRYPTION; }
	virtual EPubPointer<IEPubBuffer> Serialize() const;
	virtual EPUB_Result Deserialize(const EPubPointer<IEPubBuffer> buffer);

	virtual const EPubPointer<IEPubEncryptedData> GetEncryptedData(const char *uri) const;

	static EPUB_EncryptionMethod GetEncryptionMethod(const std::string &ns);

private:
	EncryptedDataList							m_EncryptedDataList;

};

#endif // _EPUB_BASIC_ENCRYPTION_IMP_H_